public class recusion_sum{
    public static void main(String[] args) {
        int total = 100,flag;
        lab1:
        while(total > 0){
            int sum = 0;
            for(flag = 1; flag <= total; flag++){
                System.out.println("前"+total+"的总和是："+flag);
                if(flag == 10) break lab1;
                sum += flag;
            }
            System.out.println("前"+total+"的总和是："+sum);
            total--;
        }
        System.out.println("跳出所有循环了");
    }
}